package com.yc.bran.snack.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.yc.bran.snack.bean.GoodsType;
import com.yc.bran.snack.enums.ResultEnmu;
import com.yc.bran.snack.service.IGoodsTypeService;
import com.yc.bran.snack.vo.ResultVo;


@RestController
@RequestMapping("/type")
public class GoodsTypeController {
	@Autowired
	private IGoodsTypeService goodsTypeService;
	
	@GetMapping("/list")
	public ResultVo list() {
		List<GoodsType> list = goodsTypeService.list();
		if(list == null || list.isEmpty() ) {
			return new ResultVo(ResultEnmu.DATA_NULL);
		}
		System.out.println(list);
		return new ResultVo(ResultEnmu.SUCCESS, list);
	}
}
